package nc.ui.arap.service;

import java.util.Map;

import nc.ui.ep.dj.DjPanel;
import nc.ui.pub.ClientEnvironment;
import nc.vo.arap.engine.BtnInfoVO;
import nc.vo.arap.service.ServiceVO;
import nc.vo.arap.workflow.config.ConfigAgent;
import nc.vo.pub.BusinessException;

public class BtnCall extends AbstractCall{

	
	 
	public BtnCall(DjPanel djp) {
		super(djp);
	}

	public ServiceVO getServcallVO() {
		callvo=new ServiceVO();
		callvo.setClassname("nc.itf.arap.pub.IConfigurationServicePublic");
		callvo.setMethodname("getButtons");
		callvo.setParamtype(new Class[] {String.class, String.class});
		callvo.setParam(new Object[] {parent.getDjSettingParam().getNodeID(),parent.getDjSettingParam().getPk_corp()});
		if(ClientEnvironment.getInstance().getValue(callvo.getCode())==null){
			return callvo;
		}else{
			return null;
		}
	}

	public void handleResult(Map<String, Object> datas) throws BusinessException {
		((ConfigAgent)ConfigAgent.getInstance()).getCache().putButtons(parent.getDjSettingParam().getNodeID(),parent.getDjSettingParam().getPk_corp(), (Map<String, BtnInfoVO>) datas.get(callvo.getCode()));
	}

}
